<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>BLOG</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/lib/layui/css/layui.css" media="all">
    <script src="__STATIC__/lib/layui/layui.js"></script>
    <script src="__STATIC__/admin/js/jquery-3.3.1.js"></script>
    <link id="layuicss-layuiAdmin" rel="stylesheet" href="__STATIC__/admin/css/admin.css" media="all">
    <link rel="stylesheet" href="__STATIC__/admin/css/login.css" media="all">
</head>
<body layadmin-themealias="default" class="layui-layout-body">
<div id="LAY_app" class="layadmin-tabspage-none">

    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
        <form class="layui-form" method="post" >
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>BLOG</h2>
            </div>
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required|username" placeholder="用户名" value="admin" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required|password" placeholder="密码" value="123456" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <div class='layui-col-xs6'>
                        <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                        <input type="text" name="verity" id="verity" lay-verify="required|verity" placeholder="验证码" value="" class="layui-input">
                    </div>
                    <div class="layui-col-xs6" style="border: solid 1px #ccc;height: 38px;">
                        <img src="{:captcha_src()}" class="verity" alt="captcha"  style="height: 100%;width: 100%;" onclick="this.src='{:captcha_src()}'"/>
                    </div>
                </div>
                <!--<div class="layui-form-item">-->
                    <!--<div class="layui-row">-->
                        <!--<div class="layui-col-xs7">-->
                            <!--<label class="blogadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>-->
                            <!--<input type="text" name="vercode" id="LAY-user-login-vercode" lay-verify="required" placeholder="图形验证码" class="layui-input">-->
                        <!--</div>-->
                        <!--<div class="layui-col-xs5">-->
                            <!--<div style="margin-left: 10px;margin-top: 2px;">-->
                                <!--<img src="{:captcha_src()}" onclick="this.src=this.src" class="blogadmin-user-login-codeimg" id="LAY-user-get-vercode">-->
                            <!--</div>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="layui-form-item" style="margin-bottom: 20px;">-->
                    <!--<input type="checkbox" name="remember" lay-skin="primary" title="记住密码">-->
                    <!--<div class="layui-unselect layui-form-checkbox" lay-skin="primary">-->
                        <!--<span>记住密码</span>-->
                        <!--<i class="layui-icon layui-icon-ok"></i>-->
                    <!--</div>-->
                    <!--<a lay-href="/user/forget" class="blogadmin-user-jump-change blogadmin-link" style="margin-top: 7px;">忘记密码？</a>-->
                <!--</div>-->
                <div class="layui-form-item" style="margin-top: 40px;">
                    <button class="layui-btn layui-btn-fluid" id="login" lay-submit="" lay-filter="sub">登 陆
                    </button>
                </div>
            </div>
        </div>
        </form>
        <div class="layui-trans layadmin-user-login-footer">
            <p>© 2018 LOGBC</p>
            <p>
                <span><a href="#">非法登陆,将追究法律责任</a></span>
            </p>
        </div>
    </div>
</div>
</body>
<script>

    layui.use("form",function () {
        var form=layui.form;layer=layui.layer;
        form.on("submit(sub)",function (data) {
            $.post("{:url('login/login')}",data.field,function (jsn) {
                if(jsn.code=='1'){
                    layer.msg(jsn.msg,{icon:1,time:1800},function () {
                        window.location.href="{:url('index/index')}";
                    });
                }else {
                    layer.msg(jsn.msg,{icon:5,time:1800},function () {
                        //进行验证码的刷新
                        $('.verity').attr('src',"{:captcha_src()}");
                        return false;
                    });
                }
                return false;
            });


            return false;

        });

    });




</script>


</html>